<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>报名</title>
</head>
<body>
<%
    String sex = request.getParameter("sex");
    if (sex == null) {
        application.setAttribute("boy", 0);
        application.setAttribute("girl", 0);
        application.setAttribute("count", 0);
    } else {
        int boyCount = Integer.parseInt(application.getAttribute("boy").toString());
        int girlCount = Integer.parseInt(application.getAttribute("girl").toString());
        int count = Integer.parseInt(application.getAttribute("count").toString());
        if ("男".equals(sex)) {
            application.setAttribute("boy", ++boyCount);
        } else {
            application.setAttribute("girl", ++girlCount);
        }
        application.setAttribute("count",++count);

    }
%>
<center>
<form action="baoming.jsp">
    <input type="radio" name="sex" value="男" checked>男
    <input type="radio" name="sex" value="女">女<br>
    <input type="submit" value="我要报名">
</form>
  </center>

</body>
</html>
